# @Time    :2025/3/25 8:32
"""
题目2：列表操作
给定两个列表List1=[1,2,3]和列表List2=[4,5,6],使用列表推导式生成一个包含所有可能的元素对的列表，
即[(1,4)],(1,5),(1,6),(2,4),(2,5),(2,6),(3,4),(3,5),(3,6)]

"""
list1 = [1, 2, 3]
list2 = [4, 5, 6]

# tuple_list = [(i, j) for i in list1 for j in list2 ]
# print(tuple_list)

tuple_list = [(i, j) for i in list1 for j in list2 if i>=2 and j>=5]
print(tuple_list)

result=[]
for i in list1:
    for j in list2:
        if i >= 2 and j >= 5:
            continue
        result.append(i,j)
print(result)


# tuple_list = [(i, j) for i in list1 if i>=2  for j in list2 if j>=5]
# print(tuple_list)


